<template>
	<section class="user-list">
		<CommonTable :table-config="articleClass.getTableConfig()" v-model="articleClass.selection.value">
			<template #header>
				<CommonSearch :form-data="articleClass.getSearchCol()" @search="val => articleClass.serach(val)" />
			</template>
			<template #search>
				<el-button type="primary" :icon="Edit" @click="articleClass.add()">写文章</el-button>
				<el-button
					type="danger"
					:icon="Delete"
					:disabled="!articleClass.selection.value.length"
					@click="articleClass.batchDelete()"
					>批量删除</el-button
				>
			</template>
		</CommonTable>
		<CommonDialog width="400" title="查看" v-model="articleClass.visible.value">
			<template #default>
				<PreviewImg :url="articleClass.src.value" />
			</template>
		</CommonDialog>
	</section>
</template>
<script lang="ts" setup>
import { Edit, Delete } from '@element-plus/icons-vue'
import PreviewImg from './preview-img/index.vue'
import { ArticleClass } from './controller'
let articleClass = new ArticleClass()
</script>
